import { type Directive } from 'vue'
// 键盘回车事件
export const enterDirect: Directive<HTMLElement, string> = {
  mounted(el, binding) {
    const { value } = binding
    window.addEventListener('keydown', value)
  },
  unmounted(el: any, binding: any) {
    const { value } = binding
    window.removeEventListener('keydown', value)
  }
}
